package com.example.film.mapper;

import com.example.film.entity.AreaWeekSell;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AreaWeekSellMapper {
    //查看省市每周票房信息
    @Select("select area,session,people,box_office,week from areaweeksell")
    List<AreaWeekSell> findAreaWeekSell();

    //分页查询省市每周票房信息
    @Select("select area,session,people,box_office,week from areaweeksell LIMIT #{pageSize} OFFSET #{startIndex}")
    List<AreaWeekSell> findAreaWeekSellInfo(@Param("startIndex") Integer startIndex, @Param("pageSize") Integer pageSize);

    //根据周数查询省市每周票房信息
    @Select("select area,session,people,box_office,week from areaweeksell where week=#{week}")
    List<AreaWeekSell> findAreaWeekSellByWeek(Integer week);

    //根据周数查询每周总票房信息
    @Select("select week,totalsession,totalpeople,totalsell from totalsumsession where week=#{week}")
    List<AreaWeekSell> findTotalSell(Integer week);
}
